using System.Collections;
using System.Collections.Generic;
using UFrame.TableCfg;
using UFrame.Texts;
using UnityEngine;

public class CfgLocalizationCtrl : LocalizationCtrl
{
    public void LoadFromCfg(Table<LocalizationCfg> localizationCfg)
    {
        using (var enumerator = localizationCfg.GetListEnumerator())
        {
            while (enumerator.MoveNext())
            {
                var current = enumerator.Current;
                MakeKeyIndex(current.key, current.id);
                SetText(current.ID, current.cn, (int)SystemLanguage.Chinese);
                SetText(current.ID, current.en, (int)SystemLanguage.English);
                SetText(current.ID, current.jp, (int)SystemLanguage.Japanese);
                SetText(current.ID, current.tw, (int)SystemLanguage.ChineseTraditional);
            }
        }
    }
}
